package hjt.com.module_test.model;

import androidx.databinding.BaseObservable;
import androidx.databinding.Bindable;

import hjt.com.module_test.BR;

/**
 * Created by hjt on 2019/5/28.
 */

public class User extends BaseObservable {

    public String name;

    public int age;

    private String imgUrl;

    public boolean isOk() {
        return age > 10;
    }

    @Bindable
    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
        notifyPropertyChanged(BR.imgUrl);
    }

    @Bindable
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
        notifyPropertyChanged(BR.name);
    }

    @Bindable
    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
        notifyPropertyChanged(BR.age);
    }
}
